import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:largefriends/pages/lf_register/lf_register_logic.dart';
import 'package:largefriends/widgets/lf_app_bar.dart';

class LfRegisterPage extends StatefulWidget {
  const LfRegisterPage({super.key});

  @override
  State<LfRegisterPage> createState() => _LfRegisterPageState();
}

class _LfRegisterPageState extends State<LfRegisterPage> {
  final logic = Get.put(LfRegisterLogic());

  @override
  Widget build(BuildContext context) {
    return GetBuilder<LfRegisterLogic>(
      builder: (controller) {
        return WillPopScope(
          onWillPop: () async {
            controller.previous();
            return false;
          },
          child: Scaffold(
            appBar: lfAppBar(leadingCallback: () {
              controller.previous();
            }),
            body: PageView(
              controller: controller.pageController,
              // physics: const NeverScrollableScrollPhysics(),
              children: controller.pages,
              onPageChanged: (value) {
                controller.currentPage.value = value;
              },
            ),
          ),
        );
      },
    );
  }
}
